<style>
#pub_details{
	line-height: 30px;

}

#pub_details label{
	font-weight: bold;
	font-size:12px;
	padding-right: 20px;
	padding-left:10px;
}
</style>
<div class="box-header toggleNext" style="margin: 0px;">Publication :: General Information</div>
<div class="box table toggleBorder">
<table width="100%">
	<tr>
    	<td width="25%">
            <img src="<?php echo get_image(config_item('publication_images_path'), $publication->image);?>" height="240" width="200">
            <br><br>
        <?php if($publication->soft_copy!="" && $publication->soft_copy_type=="upload"){?>
                    <div><a href="<?php echo base_url().'uploads/softcopy/'.$publication->soft_copy;?>">Download soft copy</a></div>
                     <?php }elseif($publication->soft_copy!="" && $publication->soft_copy_type=="url"){?>
                    <div><a href="<?php echo $publication->soft_copy;?>" target="_blank">Download</a></div>
                    <?php }?>
                    <div><a href="javascript:document.frm_single_publication.submit();">Generate PDF</a></div>
        </td>
        <td width="75%">
        	<div id="pub_details">
                    <form id="temp_single_publication" name="frm_single_publication" method="post" action="<?php echo base_url()?>tcpdf/examples/tcpdf_single_publication.php">
                    <?php 
                    $image = $publication->image;
                    $full_path_image = ($image=="")? base_url().'/tcpdf/images/image_demo.jpg':config_item('publication_images_path').$image;?>
                    <input type="hidden" name="image" value="<?php echo $full_path_image;?>">
                    <input type="hidden" value="<?php echo $publication->title;?>" name="title">
                    <input type="hidden" value="<?php echo $publication->abstract;?>" name="abstract">
                    <input type="hidden" value="<?php echo $publication->coding;?>" name="code">
                    <input type="hidden" value="<?php echo $publication->thematic_area;?>" name="thematic_area">
                    <input type="hidden" value="<?php echo $publication->sub_thematic_area;?>" name="sub_thematic_area">
                    <input type="hidden" value="<?php echo $publication->publisher;?>" name="publisher">
                    <input type="hidden" value="<?php echo $publication->pages;?>" name="pages">
                    <input type="hidden" value="<?php echo $publication->publish_year;?>" name="publish_year">
                    <input type="hidden" value="<?php echo $publication->isbn_number;?>" name="isbn_number">
                    <input type="hidden" value="<?php echo $publication->country;?>" name="country">
                </form>
                <h2><?php echo $publication->title;?></h2>
                <p><?php echo $publication->abstract;?></p>
                <div><label>Code:</label> <?php echo $publication->coding;?></div>
                <div><label>Thematic Area:</label> <?php echo $publication->thematic_area;?></div>
                <?php if($publication->sub_thematic_area) : ?>
                <div><label>Sub-thematic Area:</label> <?php echo $publication->sub_thematic_area;?></div>
                <?php endif;?>
                <div><label>Publisher:</label><?php echo $publication->publisher;?></div>
                <div><label>No of Pages:</label><?php echo $publication->pages;?></div>
				<div><label>Year of Publication:</label><?php echo $publication->publish_year;?></div>
				<div><label>ISBN Number:</label><?php echo $publication->isbn_number;?></div>
                <div><label>Country:</label><?php echo $publication->country;?></div>
                 <div><label>Remark:</label><p style="padding-left: 10px;"><?php echo $publication->remark;?></p></div>
            </div>
      </td>
    </tr>
</table>  
</div>  
<div class="box-header toggleNext">Publication :: Quantity Detail</div>
<div class="box table toggleBorder">
<table width="100%">
	<thead>
	<tr>
    	<td colspan="2">Total Quantity for distribution</td>
        <td colspan="2">Total Quantity in Box</td>
        <td colspan="2">Total Quantity in Store</td>
        <td colspan="2">Total Quantity</td>
    </tr>
    <tr>
    	<td width="13%">English</td>
    	<td width="15%">Nepali</td>
        <td width="11%">English</td>
        <td width="13%">Nepali</td>
        <td width="11%">English</td>
        <td width="13%">Nepali</td>
        <td width="11%">English</td>
        <td width="13%">Nepali</td>
    </tr>
    </thead>
    <tbody>
    <tr>
      <td><?php echo quantity($publication->id, 'en', 'total_qty_distribution');?></td>
      <td><?php echo quantity($publication->id, 'np', 'total_qty_distribution');?></td>
      <td><?php echo quantity($publication->id, 'en', 'total_qty_box');?></td>
      <td><?php echo quantity($publication->id, 'np', 'total_qty_box');?></td>
      <td><?php echo quantity($publication->id, 'en', 'total_qty_store');?></td>
      <td><?php echo quantity($publication->id, 'np', 'total_qty_store');?></td>
      <td><?php echo quantity($publication->id, 'en', 'total_qty');?></td>
      <td><?php echo quantity($publication->id, 'np', 'total_qty');?></td>
    </tr>
    </tbody>
</table>  
</div>
<!--
    <div class="box-header toggleNext">Publication :: Borrower Detail</div>
    <div class="toggleBorder pajination">
        <div class="pajination_numbers" style="text-align: right;"></div>
        <div class="box table" style="border:0px;margin: 0px;">
            <table width="100%">
                <thead>
                  <tr>
                        <th width="40%">User Detail</th>
                        <th width="20%">Publication Type</th>
                        <th width="20%">Quantity Detail</th>
                        <th width="20%">Date Detail</th>
                 </tr>
               </thead>
           <tbody class="pajination_component">
              <?php if(count($publicationBorrowerList) > 0):?>
              <?php foreach($publicationBorrowerList as $publicationBorrower) : ?>
                    <tr id="tr_send_single_notification_<?php echo ($publicationBorrower->borrower_qty_id);?>">
                        <td>
                            <ul class="normalList">
                                 <li><span class="small padding_0left">Name:</span><strong><?php echo $publicationBorrower->first_name." ".$publicationBorrower->last_name;?><?php echo ($publicationBorrower->member_id ==0)?"(Non-member)":"(ID-".$publicationBorrower->member_id.")";?></strong></li>
                                 <li><span class="small padding_0left">Email:</span><strong><a href="mailto:<?php echo $publicationBorrower->email;?>"><?php echo $publicationBorrower->email;?></a></strong></li>
                                 <li><span class="small padding_0left">Address:</span><strong> <?php echo $publicationBorrower->address1.", ";?><?php echo "".$publicationBorrower->address2;?></strong></li>
                                 <li><span class="small padding_0left">Phone/Mobile:</span><strong><?php echo $publicationBorrower->phone1." / ";?><?php echo "".$publicationBorrower->phone2;?></strong></li>
                            </ul>
                        </td>
                        <td>
                            <div><?php echo ($publicationBorrower->type=='np')?"Nepali":"English";?></div>
                        </td>
                        <td>
                            <ul class="normalList">
                                 <li><span class="small padding_0left">Refundable:</span><strong><?php echo $publicationBorrower->refundable_qty;?></strong></li>
                                 <li><span class="small padding_0left">Non-refundable:</span><strong><?php echo $publicationBorrower->non_refundable_qty;?></strong></li>
                                 <li><span class="small padding_0left">Returned:</span><strong> <?php echo $publicationBorrower->return_qty;?></strong></li>
                                 <li><span class="small padding_0left">Left to return:</span><strong><?php echo (int)($publicationBorrower->refundable_qty)-(int)($publicationBorrower->return_qty);?></strong></li>
                            </ul>
                        </td>
                        <td>
                            <ul class="normalList">
                                 <li><span class="small padding_0left">Issue:</span><strong><?php echo $publicationBorrower->issue_date;?></strong></li>
                                 <li><span class="small padding_0left">Returned:</span><strong><?php echo $publicationBorrower->return_date;?></strong></li>
                                 <?php echo generate_delay_date($publicationBorrower->return_date);?>
                            </ul>
                        </td>
                    </tr>
              <?php endforeach; ?>
              <?php else: ?>
                <tr>
                    <td colspan="4">
                        <div class="error_message">
                        No records.
                        </div>
                    </td>
                </tr>
              <?php endif; ?>
            </tbody>
        </table>
      </div>
      <div class="pajination_numbers" style="text-align: right;"></div>
    </div>-->
<div class="padding_10top">
	<a class="button" href="<?php echo filter_url('details')?>">Back</a>
</div>